<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
			function addText(){
				let df = document.createDocumentFragment()//碎片
				for (var i = 0; i <10; i++) {
					let text = document.createElement("div")
					text.innerHTML="文字节点"
					df.appendChild(text)
				}
				document.querySelector(".con").appendChild(df)
			}
			function addPic(){
				let df = document.createDocumentFragment()
				for (var i = 0; i < 10; i++) {
					let pic =document.createElement("img")
					pic.setAttribute("src"," ../src/ok.png")
					df.appendChild(pic)
				}
				document.querySelector(".con").appendChild(df)
			}
		</script>
	</head>
	<body>
		<button type="button" onclick="addText()">添加十个文本</button>
		<button type="button" onclick="addPic()">添加十个图片</button>
		<div id="" class="con"></div>
	</body>
</html>
